package com.shuqi.model.parse.parser;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;

import com.shuqi.model.parse.HandlerBase;

public class AccountBindGetValidationParser extends HandlerBase {

    private AccountBindValidationInfo mInfo;

    private boolean isServerinfo = false;

    @Override
    public AccountBindValidationInfo getParsedData() {
        return mInfo;
    }

    @Override
    public void characters(char[] ch, int start, int length) throws SAXException {
        if (isServerinfo) {

        }
    }

    @Override
    public void startDocument() throws SAXException {
        mInfo = new AccountBindValidationInfo();
    }

    @Override
    public void startElement(String uri, String localName, String qName, Attributes attrs)
            throws SAXException {
        if (localName.equals("serverinfo")) {
            String code = attrs.getValue("state");
            String msg = attrs.getValue("message");
            mInfo.state = code;
            mInfo.msg = msg;
        }
    }

    @Override
    public void endDocument() throws SAXException {
        super.endDocument();
    }

    public static class AccountBindValidationInfo {

        public String state;

        public String msg;
    }
}
